# Create your views here.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django_mongodb_engine.storage import GridFSStorage
import json
gridfs_storage = GridFSStorage(database='mongodb')
def look(request,path):
    image_file = gridfs_storage.open(path)
    file_content = image_file.read()
    response = HttpResponse(file_content, mimetype="image/jpeg")
    response['Content-Disposition'] = 'inline; filename=%s'%path
    return response

def changeCuisines(request,pk):
    
    context_instance=RequestContext(request)
    return json.JSONEncoder(request.cuisines_dict['level_two'][pk])
 
 